<?php
/**
 * 记录每一个库存的库存值表：存放一个库存的尺码方面的信息
 * String id：ID
 * String sku：唯一sku
 * String size：尺码
 * String title：标题
 * String size_value_id：size_value的id
 * String times：属于第几次扫描
 * String inventory_value：本次扫描值
 */
class App_Model_StockInventory extends App_Model_Abstract
{
	public function init()
	{
		parent::init();
		$this->table = App_Db_Table::factory('StockInventory');
	}
	
	public function add($row)
	{
		return $this->table->insert($row);
	}
	
	public function getStockInventory($fieldArray)
	{
		$select = $this->table->select();
		if($fieldArray!=null){
			foreach ($fieldArray as $field => $value){
				$select->where("$field = ?",$value);
			}
		}
		return $this->table->fetchAll($select);
	}
	
}